package com.changanw.storage.mapper;

import com.changanw.storage.model.Storage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestParam;

@Mapper
public interface StorageMapper {

    @Select("select * from storage_tbl where productId = #{productId}")
    Storage getStorageByProductId(@RequestParam("productId") String productId);

    @Update("update storage_tbl set count = #{count},freezeCount = #{freezeCount} where productId = #{productId}")
    Integer updateStorage(Storage storage);
}
